﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;

namespace EmailComm
{
    class Program
    {
        static void Main(string[] args)
        {
            Encoding encoding = Encoding.GetEncoding("GB2312");
            MailAddress from = new MailAddress("lukunyx@gmail.com", "test", encoding);
            MailAddress to = new MailAddress("lukunyx@qq.vip.com");

            MailMessage mail = new MailMessage(from, to);
            mail.Subject = "邮件主题";
            mail.Body = "邮件内容";
            mail.SubjectEncoding = encoding;
            mail.BodyEncoding = encoding;
            SmtpClient smtp = new SmtpClient("smtp.qq.com");
            smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
            smtp.UseDefaultCredentials = true;
            smtp.Credentials = new System.Net.NetworkCredential("lukunyx@gmail.com", "470285010");
            smtp.Send(mail);
        }
    }
}
